﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SksApp
{
    public partial class frmMenu : Form
    {
        private List<MenuItem> _menuItems = new List<MenuItem>();
        public List<MenuItem> MenuItems { get { return _menuItems; } }
        public MenuItem Result { get; set; }

        public frmMenu()
        {
            InitializeComponent();
        }

        private void frmMenu_Load(object sender, EventArgs e)
        {
            int i = 0;
            foreach (MenuItem item in MenuItems)
            {
                SKS.Controls.GlassButton btnShort = new SKS.Controls.GlassButton();
                btnShort.Dock = System.Windows.Forms.DockStyle.Top;
                btnShort.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(162)));
                btnShort.Location = new System.Drawing.Point(0, 0);
                btnShort.Name = "btnShort" + i.ToString();
                btnShort.Size = new System.Drawing.Size(298, 73);
                btnShort.TabIndex = 1;
                btnShort.TabStop = false;
                btnShort.Tag = item;
                btnShort.Text = item.Aciklama;
                btnShort.Click += (ss, ee) =>
                    {
                        Result = (MenuItem)(((Button)ss).Tag);
                        this.DialogResult = System.Windows.Forms.DialogResult.OK;
                    };
                this.Controls.Add(btnShort);
                i++;
            }
            this.Height = 73 * i + 2;
        }
    }
}
